﻿using System;
using System.Windows.Forms;
using Notepad_X.Classes;
namespace Notepad_X
{
    public partial class Extensions : Form
    {
        public Extensions(Main main)
        {

            InitializeComponent();
            d_label.Text = Main.app_language[Strings.Description];
            e_label.Text = Main.app_language[Strings.Extensions];
            this.Text = Main.app_language[Strings.Extensions];
            if (Main.app_settings.icons.ToLower() != "default")
            {
                if  (main.IconsCollection.Images.ContainsKey("apply"))
                {
                    _apply.Image = main.IconsCollection.Images["apply"];
                }
                if (main.IconsCollection.Images.ContainsKey("cancel"))
                {
                    _cancel.Image = main.IconsCollection.Images["cancel"];
                }
            }
        }
        public string[] EditDialog(string des,string ext)
        {
            d.Text = des;
            e.Text = ext;
            this.ShowDialog();
            return (new string[] {d.Text,e.Text});
        }
        public string[] AddDialog()
        {
            d.Text = null;
            e.Text = null;
            this.ShowDialog();
            return (new string[] { d.Text, e.Text });
        }
        private void Extensions_Load(object sender, EventArgs evt)
        {

        }

        private void _cancel_Click(object sender, EventArgs evt)
        {
            d.Text = null;
            e.Text = null;
            this.Close();
        }

        private void _apply_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
